<% @page_title = "System Logs" %>
<% loggers = [SystemLogsHelper::Logger, SystemLogsHelper::SidekiqLogger] %>

<div class="system_logs tabbable">
  <h2>System Logs</h2>
  <p class="light">To prevent performance issues admin logs output the last 2000 lines</p>
  <ul class="nav nav-tabs log-tabs" role="tablist">
    <% loggers.each do |klass| %>
      <li class="<%= (klass == SystemLogsHelper::Logger ? 'active' : '') %>">
        <%= link_to klass::file_name_noext, "##{klass::file_name_noext}", 'data-toggle' => 'tab' %>
      </li>
    <% end %>
  </ul>
  <div class="tab-content">
    <% loggers.each do |klass| %>
      <div class="tab-pane <%= (klass == SystemLogsHelper::Logger ? 'active' : '') %>" id="<%= klass::file_name_noext %>">
        <div class="file-holder" id="README">
          <div class="file-title">
            <i class="fa fa-file"><%= klass::path %></i>
          </div>
          <div class="file-content logs">
            <ol>
              <% klass.read.each do |line| %>
                <li>
                  <p>
                    <%= line.blank? ? raw('&nbsp;') : line %>
                  </p>
                </li>
              <% end %>
            </ol>
          </div>
        </div>
      </div>
    <% end %>
  </div>

